package com.sky.mapper.admin;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Category;
import com.sky.entity.Dish;
import com.sky.enumeration.AutoFill;
import com.sky.enumeration.OperationType;
import com.sky.result.Result;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    @Select("select count(id) from sky_take_out.dish where category_id = #{categoryId}")
    int findDishCountByCategoryId(Long categoryId);

    List<DishVO> getDishByPage(DishPageQueryDTO dto);


    @AutoFill(OperationType.UPDATE)
    int updateDish(Dish dish);

    DishVO getDishInfoById(Long id);

    int deleteDishByIds(List<Long> idList);

    int isStatus(List<Long> idList);

    List<DishVO> getDishListAllInfoByCategoryId(Long categoryId);
}
